import { getAlbumDetail } from '@/api/recommend'
import { useRoute } from 'vue-router'
import { processSongs } from '@/api/song'

async function useAlbumApi(songListRef) {
  const { params } = useRoute()
  const res = await getAlbumDetail({ id: params.id })
  const songsWithUrl = await processSongs(res.result.songs)
  songListRef.value = songsWithUrl
  return {
    songList: songListRef
  }
}

export default useAlbumApi
